package cn.oug.coffee;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.ViewFlipper;

public class Ad extends Activity {
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_ad);

		ViewFlipper vflipper = (ViewFlipper) findViewById(R.id.flipper_ad);

		vflipper.addView(addImageById(R.drawable.ad1));
		vflipper.addView(addImageById(R.drawable.ad2));
		vflipper.addView(addImageById(R.drawable.ad3));
		
		vflipper.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});

	}

	public View addImageById(int i) {
		ImageView iv = new ImageView(this);
		iv.setImageResource(i);

		return iv;
	}
}
